<?php
drupal_add_js(drupal_get_path('module', 'custom'). '/Scripts/carousel.js');
//print_r(array_keys((array)$node));

$nodestuff = array('Air conditioning' => 'field_pro_air_con',
                   'Bath' => 'field_pro_bath' ,
                   'Bathrooms' => 'field_pro_bathrooms' ,
                   'Beach' => 'field_pro_beach' ,
                   'Bedrooms' => 'field_pro_bedrooms' ,
                   'Child proof' => 'field_pro_child' ,
                   'Dishwasher' => 'field_pro_dishwash' ,
                   'Handicap' => 'field_pro_handicap' ,
                   'Internet' => 'field_pro_intnet' ,
                   'Jacuzzi' => 'field_pro_jacuzzi' ,
                   'Laundry' => 'field_pro_laundry' ,
                   'Non-smokers' => 'field_pro_non_smokers' ,
                   'Ocean' => 'field_pro_ocean' ,
                   'Pool' => 'field_pro_pool' ,
                   'Smokers' => 'field_pro_smokers'
                   );
?>
<div class="node <?php print $classes; ?>" id="node-<?php print $node->nid; ?>">
  <div class="node-inner">
    <div class="col-left">
      <div class="content-exemple clearfix">
        <div class="bloc-descrip">
          <h3 class="titre"><?php echo $node->title . ' (' . $node->field_pro_cvrnum[0]['value'] . ')';?></h3>
        </div>
        
        <div class="bloc-left">
          <div id="cvr_hpslideshow" class="carousel">
            <div class="pager">
              <ul>
              <?php                 
              foreach($node->field_pro_gal as $id => $image) {
                $class = ($id > 0) ? 'hide' : '';
                $active = ($id == 0) ? 'active' : '';
                print '<li class="' . $active . '" rel="' . $id . '"><a href="#">' . ($id+1) . '</a></li>';
                $carousel .= '<li class="' . $class . '" rel="' . $id . '">' . $image['view']. '</li>';
              }
              ?>
              </ul>
            </div>
            
            <div class="inner-carousel">
              <ul id="hpslideshow">
                <?php print $carousel; ?>
              </ul>
            </div>
          </div>
          
          <div class="property-details">
            <?php echo $node->content['body']['#value'];?>
          </div>
        </div>
      </div>
      
      <div class="property-table">
        <div class="property-features">
          <h4>Features :</h4>
        </div>
        <table width="550" border="1" cellspacing="0" cellpadding="0">
          <tr style="background:#e3d8ba;">
            <td colspan="3"><p style="margin:0;padding:0;font-size:13px;text-align:center">General</p></td>
          </tr>
          <tr>
            <td colspan="1">
              <p style="margin:0;padding:0;font-size:14px">Beds</p>
            </td>
            <td colspan="2">
              <?php print $node->field_pro_beds[0]['value']; ?>
            </td>
          </tr>
          <tr>
            <td colspan="1">
              <p style="margin:0;padding:0;font-size:14px">Island</p>
            </td>
            <td colspan="2">
              <?php print $node->field_pro_island[0]['view']; ?>
            </td>
          </tr>
          <tr>
            <td colspan="1">
              <p style="margin:0;padding:0;font-size:14px">Sleeps</p>
            </td>
            <td colspan="2">
              <?php print $node->field_pro_sleep[0]['value']; ?>
            </td>
          </tr>
          
          <tr style="background:#e3d8ba;">
            <td colspan="3"><p style="margin:0;padding:0;font-size:13px;text-align:center">Amenities</p></td>
          </tr>
          <tr>
            <td colspan="3"><p style="margin:0;padding:0;font-size:13px;text-align:left;line-height:16px"><?php echo $node->field_pro_amen[0]['value'];?></p></td>
          </tr>
          
          <tr style="background:#e3d8ba;">
            <td colspan="3"><p style="margin:0;padding:0;font-size:13px;text-align:center">Info sheet</p></td>
          </tr>
          <?php
          $tick = theme('imagecache', 'tick_cross', drupal_get_path('theme', 'basic') . '/images/tick.gif');
          $cross = theme('imagecache', 'tick_cross', drupal_get_path('theme', 'basic') . '/images/cross-icon.gif');
          
          foreach ($nodestuff  as $id => $val) {
            $soval = $node->{$val}[0]['value'];
          ?>
            <tr>
              <td><p style="margin:0;padding:0;font-size:14px"><?php print $id; ?></p></td>
              <td><?php if ($soval != 0) print $tick; ?></td>
              <td><?php if ($soval == 0) print $cross; ?></td>
            </tr>
          <?php } ?>
        </table>
      </div>
      
      <div class="show-rates">
        <div class="property-features">
          <h4>Rates :</h4>
        </div>
        <table width="550" border="1" cellspacing="0" cellpadding="0">
          <tr style="background:#e3d8ba;">
            <td colspan=2><?php print t('Season'); ?></td>
            <td colspan=1><p style="margin:0;padding:0;font-size:13px;text-align:center"><?php print $node->field_pro_rates[0]['view']; ?></p></td>
          </tr>
          <tr>
            <td colspan=2><p style="margin:0;padding:0;font-size:13px;text-align:left"><?php print t('Christmas'); ?></p></td>
            <td colspan=1><p style="margin:0;padding:0;font-size:13px;text-align:center"><?php print $node->field_pro_rate_christmas[0]['value']; ?></p></td>
          </tr>
          <tr>
            <td colspan=2><p style="margin:0;padding:0;font-size:13px;text-align:left"><?php print t('High Season'); ?></p></td>
            <td colspan=1><p style="margin:0;padding:0;font-size:13px;text-align:center"><?php print $node->field_pro_rate_high[0]['value']; ?></p></td>
          </tr>
          <tr>
            <td colspan=2><p style="margin:0;padding:0;font-size:13px;text-align:left"><?php print t('Low Season'); ?></p></td>
            <td colspan=1><p style="margin:0;padding:0;font-size:13px;text-align:center"><?php print $node->field_pro_rate_low[0]['value']; ?></p></td>
          </tr>
        </table>
      </div>
      
      <div class="contact-options">
        <?php print l('Make a reservation', 'node/add/contact-request', array('query' => array('nid' => $node->nid, 'type' => 'reservation'))); ?>
        <?php print l('Contact owner', 'node/add/contact-request', array('query' => array('nid' => $node->nid, 'type' => 'contact'))); ?>
      </div>
    </div><!--end .col-left-->
  </div> <!-- /node-inner -->
</div> <!-- /node-->

